<!--
 * 滑动块
 *
 * @Author: Reisen
 * @Date: 2025-11-26
-->
<template>
  <div class="swiper">
    <el-carousel :interval="200000" type="card" height="280px">
      <el-carousel-item v-for="(item, index) in swiperList" :key="index">
        <div class="carousel-item-content">
          <img :src="item.picImg" />
          <div class="carousel-item-overlay">
          </div>
        </div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import { swiperList } from '../assets/data/swiper'
export default {
  name: 'swiper',
  data () {
    return {
      swiperList: []
    }
  },
  created () {
    this.swiperList = swiperList
  }
}
</script>

<style lang="scss" scoped>
.swiper {
  padding: 20px;
  background-color: #f0f8ff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.el-carousel {
  border-radius: 8px;
  overflow: hidden;
}

.carousel-item-content {
  position: relative;
  height: 100%;
}

.carousel-item-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px;
  text-align: center;
}

.carousel-item-overlay p {
  margin: 0;
  font-size: 18px;
}
</style>
